import React, { useEffect } from 'react';
import { connect } from 'react-redux';
// import store from '../redux/store';
function NotFound(props){
    useEffect(()=>{
        console.log(props)
        // console.log("进入404")
        //store.dispatch通知
        // store.dispatch({
        //     type:"404传的消息",
        //     val:"碰磕",
        //     isShow:false
        // })
        props.hide()
        return()=>{
            console.log("销毁...");
            props.show()
        }
    },[])
    return (
        <div>
            404
        </div>
    );
}
//connect(将来给孩子传的属性,将来给孩子传的回调函数)
export default connect(null,{
    hide(){
        return{
            type:"404传的消息",
            isShow:false
        }
    },
    show(){
        return{
            type:"404传的消息",
            isShow:true
        }
    }
})(NotFound)